package com.yyi.springcloud.service;
//
//                       _oo0oo_
//                      o8888888o
//                      88" . "88
//                      (| -_- |)
//                      0\  =  /0
//                    ___/`---'\___
//                  .' \\|     |// '.
//                 / \\|||  :  |||// \
//                / _||||| -:- |||||- \
//               |   | \\\  -  /// |   |
//               | \_|  ''\---/''  |_/ |
//               \  .-\__  '-'  ___/-. /
//             ___'. .'  /--.--\  `. .'___
//          ."" '<  `.___\_<|>_/___.' >' "".
//         | | :  `- \`.;`\ _ /`;.`/ - ` : | |
//         \  \ `_.   \_ __\ /__ _/   .-` /  /
//     =====`-.____`.___ \_____/___.-`___.-'=====
//                       `=---='
//
//
//     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
//               佛祖保佑         永无BUG
//

import com.github.pagehelper.PageInfo;
import com.yyi.springcloud.common.PageInfoResult;
import com.yyi.springcloud.entities.*;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.OutputStream;
import java.util.List;

/**
 * @author: yyi
 * @date: 2019/7/16 9:13
 * @parameters:
 * @desc:
 **/
@FeignClient(value = "MICROSERVICECLOUD-DEPT")
public interface CurveService {
    //获取曲线左侧的传感器列表
    @RequestMapping("/mysqlapi/SensorInfoAPI/getSensorInfoByCondition")
     List<SensorInfoModel> getSensorInfoByCondition(@RequestParam("labcode") String labcode,@RequestParam("primaryKey") String primaryKey);
    //根据实验室编码获取最新一条
    @RequestMapping("/mysqlapi/TestData/getNewOneTestData")
     List<TestDataDto> getNewOneTestData(@RequestParam("primaryKey") String primaryKey,@RequestParam("sensorNo") String sensorNo);
    //根据实验室编码查询所有的在测台位铭牌信息(测试元数据)
    @RequestMapping("/mysqlapi/TestProdInfoValue/getAllTestProdInfoValue")
     PageInfo<TestProdInfoValueModel> getAllTestProdInfoValue(@RequestParam("labcode") String labcode,@RequestParam("pageNum") String pageNum,@RequestParam("pageSize") String pageSize);
    //设置坐标轴列表
    @RequestMapping("/mysqlapi/CoordonateInfoApi/getCoordonate")
     List<CoordonateVo> getCoordonate(@RequestParam("primaryKey") String primaryKey);
    //根据x轴值获取y轴值(请求后台获取)
    /**
     * 参数 labcode,primaryKey,sensorNo,xAxisValue
     *
     */
    @RequestMapping("/mysqlapi/TestData/getYAxisValue")
     String getYAxisValue(@RequestParam("labcode") String labCode,@RequestParam("primaryKey") String primaryKey,@RequestParam("sensorNo") String sensorNo,@RequestParam("xAxisValue") String xAxisValue);
    //获取测试单元数据（名牌信息）
    @RequestMapping("/mysqlapi/TestProdInfo/listTestProdInfoItems")
     List<TestProdInfoItemModel> listTestProdInfoItems();
    //获取某个台位的测试元数据(铭牌信息)
    @RequestMapping("/mysqlapi/TestProdInfo/getTestProdInfo")
    List<TestProdInfoVo> getTestProdInfo(@RequestParam("labcode") String labcode,@RequestParam("testunitno") String testunitno,@RequestParam("pageNum") String pageNum,@RequestParam("pageSize") String pageSize);
    //传感器设置，查找出所有的传感器信息
    @RequestMapping(value = "/mysqlapi/SensorNameAPI/getAllSensorName")
    List<Select2> getSensorInfoByCondition();
    //查询出台位对应的所有的传感器分组信息 参数primaryKey
    @RequestMapping("/mysqlapi/GroupInfo/getAllGroupInfoByCondition")
    List<GroupInfoModel> getAllGroupInfoByCondition(@RequestParam("primaryKey") String primaryKey);
    //根据groupNo 获取 sensorInfo
    @RequestMapping("/mysqlapi/SensorInfoAPI/getSensorInfoByGroupNo")
    List<SensorInfoModel> getSensorInfoByGroupNo(@RequestParam("primaryKey") String primaryKey,@RequestParam("groupNo") String groupNo);
    //查询出所有未分配的传感器
    //http://localhost/consumer/CurveInfoAPI/listUngroupedSensors?primaryKey=2017-11-1611:17:211
    @RequestMapping("/mysqlapi/SensorInfoAPI/listUngroupedSensors")
    List<SensorInfoModel> listUngroupedSensors(@RequestParam("primaryKey") String primaryKey);
    //通过primaryKey更新传感器信息
    @RequestMapping("/mysqlapi/SensorInfoAPI/updateSensorsByPrimaryKey")
    String updateSensorsByPrimaryKey(SensorInfoVo sensorInfoVo);
    //根据primaryKey和传感器编号查询该传感器的所有的测试数据
    @RequestMapping("/mysqlapi/TestData/getSensorTestDataNow")
    List<CurveVo> getSensorTestDataNow(@RequestParam("labcode") String labcode,@RequestParam("primaryKey") String primaryKey,@RequestParam("sensorno") String sensorno);
    //获取所有选择的传感器 根据primaryKey查询被使用的传感器信息
    @RequestMapping("/mysqlapi/TestData/getAllSelectSensorName")
    List<SensorInfoModel> getAllSelectSensorName(@RequestParam("primaryKey") String primaryKey);
    //获取数据列表
    @RequestMapping("/mysqlapi/TestData/getAllTestDataVo")
    PageInfoResult<TestDataVo> getAllTestDataVo(@RequestParam("labcode") String labcode,@RequestParam("testunitno") String testunitno,@RequestParam("startdate") String startdate,@RequestParam("enddate") String enddate,
                                                @RequestParam("pageNum") String pageNum,@RequestParam("pageSize") String pageSize);
    //根据primaryKey,传感器分组编号,开始时间和结束时间等查询并统计传感器信息(统计值专用)
    @RequestMapping("/mysqlapi/TestData/getStatisticsSensorInfoByCondition")
    List<TestDataStatisticsVo> getStatisticsSensorInfoByCondition(@RequestParam("primaryKey") String primaryKey,@RequestParam("groupNo") String groupNo,@RequestParam("startTime") String startTime,@RequestParam("endTime") String endTime);
    //导出表格
    @RequestMapping("/mysqlapi/TestData/exportTestData")
    void exportTestData(@RequestParam("labCode") String labCode, @RequestParam("testUnit") int testUnit, @RequestParam("startDate") String startDate, @RequestParam("endDate") String endDate);
    //将数据存放到redis 中
    @RequestMapping("/mysqlapi/pageData/putDivCruveData")
    String putDivCruveData(@RequestParam("primaryKey") String primaryKey,@RequestParam("cruveData") String cruveData);
    //将页面中的canvas曲线数据保存到redis中
    @RequestMapping("/mysqlapi/pageData/putCanvasCruveData")
    String putCanvasCruveData(@RequestParam("primaryKey") String primaryKey,@RequestParam("cruveData") String cruveData);
    //将左侧页面中的传感器信息保存到redis中
    @RequestMapping("/mysqlapi/pageData/putLeftSensorData")
    String putLeftSensorData(@RequestParam("primaryKey") String primaryKey,@RequestParam("cruveData") String cruveData);
    //根据实验室编码查询所有的在测台位的铭牌信息（测试单元数据），查询所有台位的开测信息
    @RequestMapping("/mysqlapi/TestProdInfoValue/getAllTestProdInfoValueNow")
    List<TestProdInfoValueModel> getAllTestProdInfoValueNow(@RequestParam("labcode") String labcode);
    //
    @RequestMapping("/mysqlapi/pageData/getDivCruveData")
    String getDivCruveData(@RequestParam("primaryKey") String primaryKey);

    @RequestMapping("/mysqlapi/pageData/getLeftSensorData")
    String getLeftSensorData(@RequestParam("primaryKey") String primaryKey);

}
